import React from 'react'
import { LeftOutline } from "antd-mobile-icons";
import { useNavigate } from "react-router-dom"
// 接收PROPS接口类型
interface ForgetHeaderProps {
    title:string
}
const ForgetHeader : React.FC<ForgetHeaderProps>= ({title})=> {
    const navigate=useNavigate()
    // 历史记录返回上一页
    const back=()=>{
        navigate(-1)
    }
  return (
    <div className='ForgetHeaderBox'
    style={{
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center',
        width: '100%',
        height: '40px',
        position:'fixed',
        top: '0px',
        left: '0px',
        paddingTop:'10px',
        backgroundColor:'rgba(48,135,234)'
    }}>
      <span style={{
        fontSize:'20px',
        color:'#fff'
      }}>{title}</span>
      <LeftOutline style={{
        position:'absolute',
        fontSize:'20px',
        fontWeight:'bold',
        color:'#fff',
        left: '15px',
      }}
      onClick={back}
      />
    </div>
  )
}
export default ForgetHeader